

OMIT('_EndOfInclude_',_calldllclPresent_)
_calldllclPresent_ EQUATE(1)

!Other Classes
!  Include('OtherClass.INC')

!Equates - will be seen by using program

calldllclType Class,type,module('calldllcl.CLW'),LINK('calldllcl.CLW',_ABCLinkMode_),DLL(_ABCDllMode_)
!Member Data
hdll        long
debug       byte
ApiErrorcode long
AddressQ    &AddressQType
eProcFail   long !Result to return if getaddress fails during an call_pX function call.
ErrorStr    string(256)
ignorehdll  byte  !if true are using the class without loading a dll 

!Methods - all return 0 for success if they return anything
construct           procedure()
destruct            procedure()
init                procedure(string pDllPath, byte pDebug=0),byte
SetProcFailCode     procedure(long pFailcode),byte,proc !default is 0
kill                procedure()

!add an address to the addressQ.  
addaddress          Procedure(string procname, long lpProcName),byte,proc
!see also addaddressDeRef() in the utility section

! If procname is not found in the addressq,
!  getprocaddress is called to find the address if a dll has been loaded
GetAddress          Procedure(string procname),long

!call options using the pascal calling convention
call                procedure(string procname, <long p1>,<long p2>,<long p3>,<long p4>,<long p5>,<long p6>,<long p7>,<long p8>,<long p9>,<long p10>),long,proc
callbyAddress       procedure(long lpAddress, <long p1>,<long p2>,<long p3>,<long p4>,<long p5>,<long p6>,<long p7>,<long p8>,<long p9>,<long p10>),long,proc

!call options using the c calling convention
ccall               procedure(string procname, <long p1>,<long p2>,<long p3>,<long p4>,<long p5>),long,proc
ccallbyAddress      procedure(long lpAddress, <long p1>,<long p2>,<long p3>,<long p4>,<long p5>),long,proc


!Start options
Start               procedure(String pMdiForm, long StackSize=0,<string pS1>,<String pS2>,<String pS3>),long,proc
StartByAddress      procedure(long lpMDiForm, long StackSize=0,<string ps1>,<string pS2>, <string pS3>),long,proc

!alternative call formats - no advantage to these other than a slight speed advantage
call_p0             procedure(string procname),long,proc
call_p1             procedure(string procname, long p1),long,proc
call_p2             procedure(string procname, long p1, long p2),long,proc
call_p3             procedure(string procname, long p1, long p2, long p3),long,proc
call_p4             procedure(string procname, long p1, long p2, long p3, long p4),long,proc
call_p5             procedure(string procname, long p1, long p2, long p3, long p4,long p5),long,proc
call_p8         procedure(string procname, long p1, long p2, long p3, long p4,long p5,long p6,long p7,long p8),long,proc
ccall_p0            procedure(string procname),long,proc
ccall_p1            procedure(string procname, long p1),long,proc
ccall_p2            procedure(string procname, long p1, long p2),long,proc
ccall_p3            procedure(string procname, long p1, long p2, long p3),long,proc
ccall_p4            procedure(string procname, long p1, long p2, long p3, long p4),long,proc
ccall_p5            procedure(string procname, long p1, long p2, long p3, long p4,long p5),long,proc


!wraps the formatmessage api
GetLastError        procedure(),ulong
FormatErrMsg        procedure(*string msg,long EC),byte,proc
FormatErrMsg        Procedure(*string msg),byte,proc

!saves and optionally displays any errors generated by the class
takeError           procedure(string pErrorStr)  !Error messages not suitable for the user

!utility functions for dereferencing an address - typically an address returned by address() where
! the function or variable is in a dll
DerefPointer  procedure(long lpPointer, *long pDeref),byte !return the value stored at lpPointer in pDeRef
AddAddressDeref  procedure(long lpPointer, string pName),byte !add deref() of lpPointer to the addressQ rather then lpPointer



    end
 !_EndOfInclude_
